//
//  BaseViewController.m
//  LittleSugar
//
//  Created by zhang on 15-6-13.
//  Copyright (c) 2015年 张鑫. All rights reserved.
//

#import "BaseViewController.h"
#import "MyControl.h"
#import "AdView.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)addTitleViewWithTitle:(NSString *)title {
    UILabel *titleLabel = [MyControl creatLabelWithFrame:CGRectMake(0, 0, 200, 30) text:title];
    titleLabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:18];
    
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.textColor = [UIColor colorWithRed:255/255.0f green:153/255.0f blue:153/255.0f alpha:1];
    
    self.navigationItem.titleView = titleLabel;
}
- (void)addItemWithTitle:(NSString *)title
                  target:(id)target
                  action:(SEL)action
                  isLeft:(BOOL)isLeft {
    UIButton *button = [MyControl creatButtonWithFrame:CGRectMake(0, 0, 15, 15) target:target sel:action tag:100 image:@"tab_search" title:title];
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    
    UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:button];
    if (isLeft) {
        self.navigationItem.leftBarButtonItem = item;
    }else{
        self.navigationItem.rightBarButtonItem = item;
    }
}

//#pragma mark - 加滚动新闻
//-(void)addAdView:(NSMutableArray *)imageNames textArr:(NSMutableArray *)textArr{
//    AdView *adView = [[AdView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 150)];
//    adView.textArr = textArr;
//    
//    adView.imageNames = imageNames;
//    
//    self.tableView.tableHeaderView = adView;
//    
//    //self.tableView.showsHorizontalScrollIndicator = NO;
//}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
